/*
 * inotify-sync - a simple file synchronizer and file system watcher
 * Copyright (C) 2010-2011, inotify-sync developers and inotify-sync contributors
 * Copyright (C) 2010-2011, Cohesion Network Security Studio
 *
 * inotify-sync is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * inotify-sync is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with inotify-sync; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

/*
 * FILE:		Syncer.h
 * USAGE:		---
 * DESCRIPTION:		---
 * OPTIONS:		---
 * REQUIREMENTS:	---
 * BUGS:		---
 * NOTES:		---
 * AUTHOR:		LI Yiwei (mail:leeyiw@gmail.com)
 * COMPANY:		---
 * VERSION:		1.0
 * CREATED:		Wed Nov 23 21:13:39 CST 2011
 * REVISION:		---
 */


#ifndef SYNCER
#define SYNCER

#include <string>
#include <stdio.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <inttypes.h>

#include "Profile.h"
#include "Converter.h"

extern Converter Conv;

class Syncer
{
public:
	Syncer();
	virtual ~Syncer();

	virtual void sync_create_file(std::string abs_path);
	virtual void sync_create_dir(std::string abs_path);
	virtual void sync_delete(std::string abs_path);
	virtual void sync_modify(std::string abs_path);
	virtual void sync_moved_from(std::string abs_path,uint32_t cookie);
	virtual void sync_moved_to(std::string abs_path);
	virtual void sync_move_inside(std::string abs_path,uint32_t cookie);
	//重载，用于分时同步
	virtual void sync_move_inside(std::string src_path,
					std::string dest_path);
protected:
	Profile profile;
	std::string get_dest_path(std::string src_abs_path);
private:
};

#endif
